<template>
  <div>
    <h1 v-text="msg" ref="title"></h1>
    <button @click="showDom">点击输出</button>
    <School></School>
  </div>
</template>

<script>
// 引入School 组件
import School from "./components/School.vue";

export default {
  name: "App",
  components: {
    School,
  },
  data() {
    return {
      msg: "欢迎学习Vue~",
    };
  },

  methods: {
    showDom() {
      // 获得元素 对应 document.getElementById('title')
      console.log(this.$refs.title);
    },
  },
};
</script>
